package com.doitedu.day03

/**
 * @Date 22.6.22
 * @Created by HANGGE
 * @Description
 */
object TupleDemo {
  def main(args: Array[String]): Unit = {
    val tuple = (1, "zss", 23, "f", 10000)
    val name = tuple._2
   // 数据类型是  Any
    val iterator= tuple.productIterator
   // 数字*10  字符串转大写
    val data = iterator.map(e=>{
      //if  else 作为返回结果
      if (e.isInstanceOf[Int]){
        // 类型转换
        val i= e.asInstanceOf[Int]
       i*10
      }else{
        e.asInstanceOf[String].toUpperCase()
      }
    })

   data.foreach(println)


  }

}
